<%-- 
    Document   : pelaporan
    Created on : Dec 18, 2013, 10:59:05 AM
    Author     : brlnt
--%>
<%@page import="java.util.List"%>
<%@page import="model.PelaporanBean"%>
<%@page import="DBController.PelaporanDB"%>
<%@include file="../template/header.jsp" %>
<% UserBean sesiUser = (UserBean) session.getAttribute("sesiUser"); %>
<!-- script src="${initParam.js}/jquery.dataTables.js"></script>
<script src="${initParam.js}/bootstrap.dataTables.js"></script>
<link href="${initParam.css}/dataTables.css" type="text/css"/>
<style>.pagination{margin:0}</style -->
<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <h3>${title}</h3>
        <hr>
        <div class="form-group">
            <a href="./pelaporan?action=add" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> Tambah Pelaporan</a>
        </div>
        <table id="table" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">
            <thead>
            <th>No</th>
            <th>Nama Sungai</th>
            <th>Lokasi</th>
            <th>Status</th>
            <th colspan="2">Action</th>
            </thead>
            <tbody>
                <%
                    List listdata = (List) request.getAttribute("listdata");
                    int n = 1;
                %>
                <% for (int i = 0; i < listdata.size(); i++) {
                        PelaporanBean data = (PelaporanBean) listdata.get(i);%>
                <tr>
                    <td><%=n++%></td>
                    <td><%=data.getNamasungai()%></td>
                    <% if (data.getStatus() == 1) { %>
                    <td><i class="glyphicon glyphicon-ok"></i> Tervalidasi</td>
                    <% } else if (data.getStatus() == 0) { %>
                    <td><i class="glyphicon glyphicon-remove"></i> Belum Tervalidasi</td>
                    <% } else if(data.getStatus() == -1) { %>
                    <td><i class="glyphicon glyphicon-warning-sign"></i> Tidak Tervalidasi</td>
                    <% } %>
                    <td>
                        <a href="./pelaporan?action=edit&id=<%=data.getIdPelaporan()%>" class="btn btn-primary">
                            <i class="glyphicon glyphicon-pencil"></i> Edit
                        </a> 
                    </td><td>
                        <a href="./pelaporan?action=delete&id=<%=data.getIdPelaporan()%>" class="btn btn-danger">
                            <i class="glyphicon glyphicon-trash"></i> Hapus
                        </a>
                    </td>  
                </tr>
                <% }%>
            </tbody>
        </table>
    </div>
</div>
<%@include file="../template/footer.jsp" %>
